EAPI=7

EGIT_REPO_URI="https://github.com/mosra/magnum.git"

inherit cmake git-r3

DESCRIPTION="C++11/C++14 graphics middleware for games and data visualization"
HOMEPAGE="https://magnum.graphics"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

RDEPEND="
	dev-libs/corrade
	media-libs/openal
	media-libs/glfw
	media-libs/libsdl2
"
DEPEND="${RDEPEND}"

src_configure() {
	local mycmakeargs=(
		-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
		-DCMAKE_BUILD_TYPE=Release
		-DMAGNUM_WITH_AUDIO=ON
		-DMAGNUM_WITH_GLXAPPLICATION=ON
		-DMAGNUM_WITH_GLFWAPPLICATION=ON
		-DMAGNUM_WITH_SDL2APPLICATION=ON
		-DMAGNUM_WITH_WINDOWLESSGLXAPPLICATION=ON
		-DMAGNUM_WITH_EGLCONTEXT=ON
		-DMAGNUM_WITH_GLXCONTEXT=ON
		-DMAGNUM_WITH_OPENGLTESTER=ON
		-DMAGNUM_WITH_ANYAUDIOIMPORTER=ON
		-DMAGNUM_WITH_ANYIMAGECONVERTER=ON
		-DMAGNUM_WITH_ANYIMAGEIMPORTER=ON
		-DMAGNUM_WITH_ANYSCENECONVERTER=ON
		-DMAGNUM_WITH_ANYSCENEIMPORTER=ON
		-DMAGNUM_WITH_ANYSHADERCONVERTER=ON
		-DMAGNUM_WITH_MAGNUMFONT=ON
		-DMAGNUM_WITH_MAGNUMFONTCONVERTER=ON
		-DMAGNUM_WITH_OBJIMPORTER=ON
		-DMAGNUM_WITH_TGAIMAGECONVERTER=ON
		-DMAGNUM_WITH_TGAIMPORTER=ON
		-DMAGNUM_WITH_WAVAUDIOIMPORTER=ON
		-DMAGNUM_WITH_DISTANCEFIELDCONVERTER=ON
		-DMAGNUM_WITH_IMAGECONVERTER=ON
		-DMAGNUM_WITH_SCENECONVERTER=ON
		-DMAGNUM_WITH_SHADERCONVERTER=ON
		-DMAGNUM_WITH_FONTCONVERTER=ON
		-DMAGNUM_WITH_GL_INFO=ON
		-DMAGNUM_WITH_AL_INFO=ON
	)
	cmake_src_configure
}

src_install() {
	cmake_src_install
	mkdir "${ED}/usr/$(get_libdir)/magnum/"
	cp -av "${BUILD_DIR}"/Gentoo/lib/magnum/* "${ED}/usr/$(get_libdir)/magnum/" || die
}

# kate: replace-tabs off;
